package com.cskaoyan.controller.wx.sl;

import com.cskaoyan.bean.Topic;
import com.cskaoyan.service.wx.sl.WxTopicService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.wx.sl.TopicDetailVo;
import com.cskaoyan.vo.wx.sl.WxTopicListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WxTopicController {

    @Autowired
    WxTopicService wxTopicService;

    //显示专题列表
    @RequestMapping("wx/topic/list")
    public BaseRespVo topicList(Integer page,Integer size){
        WxTopicListVo wxTopicListVo = wxTopicService.topicList(page,size);
        return BaseRespVo.ok(wxTopicListVo);
    }
    //显示专题详情
    @RequestMapping("wx/topic/detail")
    public BaseRespVo topicDetail(Integer id){
        TopicDetailVo topicDetailVo = wxTopicService.TopicDetail(id);
        return BaseRespVo.ok(topicDetailVo);
    }
    //专题推荐
    @RequestMapping("wx/topic/related")
    public BaseRespVo topicRelated(Integer id){
        Topic topic = wxTopicService.topicRelated(id);
        return BaseRespVo.ok(topic);
    }

}
